package org.aeon.heroicsagatextedition.round.factory;

import org.aeon.heroicsagatextedition.exception.GameException;
import org.aeon.heroicsagatextedition.role.product.RoleUnit;
import org.aeon.heroicsagatextedition.round.product.HeroRound;
import org.aeon.heroicsagatextedition.round.product.MonsterRound;
import org.aeon.heroicsagatextedition.round.product.Round;

/**
 * @projectName: HeroicSagaTextEdition
 * @package: org.aeon.heroicsagatextedition.round.factory
 * @className: RoundFactory
 * @author: MissingAeon
 * @date: 2023/12/22 15:22
 * @description: 简单回合工厂
 */
public class RoundFactory {
    public Round createRound(RoleUnit roleUnit) {
        // 根据角色阵营创建不同回合
        if (roleUnit.getCamp() == 0) {
            return new HeroRound(roleUnit);
        } else if (roleUnit.getCamp() == 1) {
            return new MonsterRound(roleUnit);
        }
        // return null;
        throw new GameException("没有阵营的角色！");
    }
}
